<?php

/**
 * SimplifyPHP Framework
 *
 * This file is part of SimplifyPHP Framework.
 *
 * SimplifyPHP Framework is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * SimplifyPHP Framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Rodrigo Rutkoski Rodrigues <rutkoski@gmail.com>
 * @copyright Copyright 2008 Rodrigo Rutkoski Rodrigues
 */

/**
 * Dictionary interface. A dictionary maps keys to values. All keys are unique.
 * 
 * @author Rodrigo Rutkoski Rodrigues, <rutkoski@gmail.com>
 * @package Simplify_Kernel_Data
 */
interface IDictionary
{

  /**
   * Copy all keys and values from $data.
   * 
   * @param IDictionary|array $data Source data.
   * @param array $except Array of keys that should not be copied.
   * @param integer $filter Null to copy all keys, FILTER_NULL to ignore null values or FILTER_EMPTY to ignore empty values.
   * @return unknown_type
   */
  //public function copyAll($data, $except = null, $filter = null);
  public function copyAll($data);

  /**
   * Del a given key.
   * 
   * @param string $name The key.
   * @return void
   */
  public function del($name);

  /**
   * Get value for given key.
   * 
   * @param string $name The keey.
   * @param mixed $default Default value.
   * @param boolean $filter Filtered values return $default.
   * @return mixed The value or $default if value is null.
   */
  //public function get($name, $default = null, $filter = null);
  public function get($name);

  /**
   * Get an associative array with all keys and values.
   * 
   * @return array
   */
  public function getAll();

  /**
   * Check if a given key is set.
   * 
   * @param string $name The key.
   * @param boolean $filter Filtered values return null. 
   * @return boolean
   */
  //public function has($name, $filter = null);
  public function has($name);

  /**
   * Clear all data and (optinally) insert new data.
   * 
   * @param array $data New data.
   * @return void
   */
  //public function reset($data = null, $except = null, $filter = null);
  public function reset($data = null);

  /**
   * Set value for a given key.
   * 
   * @param string $name The key.
   * @param mixed $value The value.
   * @return void
   */
  public function set($name, $value = null);

}

?>